package com.zhw.controller;

import com.zhw.pojo.PageBean;
import com.zhw.pojo.Result;
import com.zhw.pojo.dto.AmountDTO;
import com.zhw.pojo.dto.CustomerLossQueryDTO;
import com.zhw.pojo.entry.CustomerLoss;
import com.zhw.pojo.vo.CustomerConstituteVO;
import com.zhw.pojo.vo.CustomerLossReportVO;
import com.zhw.pojo.vo.CustomerServeReport;
import com.zhw.service.ReportService;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("report")
@Slf4j
public class ReportController {
    @Autowired
    ReportService reportService;

    @GetMapping("amount")
    public Result page(AmountDTO amountDTO){
        log.info("分页查询客户贡献信息：{}",amountDTO);
        PageBean pb =reportService.getAmount(amountDTO);
        return Result.success(pb);
    }

    @GetMapping("CustomerConstitute")
    public Result getCustomerConstitute(){
        log.info("查询客户构成分析数据");
        CustomerConstituteVO customerConstituteVO=reportService.getCustomerConstitute();
        return Result.success(customerConstituteVO);
    }

    @GetMapping("getServeReport")
    public Result getServeReport(){
        log.info("查询客户服务分析数据");
        CustomerServeReport customerServeReport=reportService.getServeReport();
        return Result.success(customerServeReport);
    }


    @GetMapping("getLoseReport")
    public Result getLoseReport(CustomerLossQueryDTO customerLossQueryDTO){
        log.info("查询客户流失分析数据");
        PageBean pb =reportService.getLose(customerLossQueryDTO);
        return Result.success(pb);
    }




}
